/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package data.sunriseset;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

/**
 *
 * @author bsmith
 */
//The XMLRootElement annotation tells JAXB what is the
//element local name it needs to look for.
@XmlRootElement(name = "sun")
public class Sun {

    private String version;
    private Location location;
    private SRSDate date;
    private Morning morning;
    private Evening evening;

        public SRSDate getDate() {
        return date;
    }

    public void setDate(SRSDate date) {
        this.date = date;
    }

    public Evening getEvening() {
        return evening;
    }

    public void setEvening(Evening evening) {
        this.evening = evening;
    }

    public Location getLocation() {
        return location;
    }

    public void setLocation(Location location) {
        this.location = location;
    }

    public Morning getMorning() {
        return morning;
    }

    public void setMorning(Morning morning) {
        this.morning = morning;
    }

        //The adapter tells JAXB to collapse white space. This is usually
    //quite good to use for Strings.
    //The XmlElement annotation tells JAXB what's the
    //actual name of the element inside <program>
    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }
    
    
    @Override
    public String toString() {
        return "Sun ["
                + (version != null ? "version=" + version + ", " : "")
                + (location != null ? " " + location + ", " : "")
                + (date != null ? " " + date + ", " : "")
                + (morning != null ? " " + morning + ", " : "")
                + (evening != null ? " " + evening : "") + "]";
    }


}
